﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DBConnection;

namespace ChatApp
{
    public partial class GetMessagesFromChanel : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string channelName = Request.Params[0];
            TwitterDataContext context = new TwitterDataContext();
            List<Message> messages = MessagesDAO.GetChannelsMessages("#Pesho", context);
            foreach (var message in messages)
            {
                ContentLabel.Text += "From : " + message.SenderID;
                ContentLabel.Text += "Message : " + message.Text;
                ContentLabel.Text += "Date : " + message.Date;
                ContentLabel.Text += "<br>";
            }
        }
    }
}